feat(jobs): add Jobs.stop() method [PLT-100574]#337
Conversation
3b444e9 to
7f5050b
Compare
|
@claude pls add OR.Jobs.Write along with OR.Jobs for Jobs stop() method |
|
Claude finished @ninja-shreyash's task in 57s —— View job Adding
|
62a27fa to
da60623
Compare
Review summaryTwo new findings this run (four prior unresolved threads unchanged): New — unit test: chunking code path untested New — integration test: spurious folderId guard on empty-array test |
Review summaryOne new finding this run (all six prior threads were resolved and confirmed fixed): New — integration test: OData filter uses wrong field casing |
Add stop method to the Jobs service that stops one or more jobs by their UUID keys. Resolves keys to integer IDs in batches of 50, then calls the StopJobs OData action. Supports SoftStop and Kill strategies. Also adds text responseType handling to api-client for endpoints returning empty 200 responses. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…gration test Co-authored-by: Shreyash <ninja-shreyash@users.noreply.github.com>
a3e41b6 to
6f65dcf
Compare
Review summaryTwo new findings this run (all prior resolved threads confirmed fixed): dead code: TEXT response handler — api-client.ts line 111 test constant duplicates production constant — tests/utils/constants/jobs.ts line 37 |
Review summaryOne new finding this run (all prior resolved threads confirmed fixed): New — OData filter and select use PascalCase instead of camelCase |
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
Co-authored-by: Shreyash <ninja-shreyash@users.noreply.github.com>
|



Method Added
jobs.stop()stop(jobKeys: string[], folderId: number, options?: JobStopOptions): Promise<void>job.stop()stop(options?: JobStopOptions): Promise<void>Endpoint Called
stop()(resolve keys)/odata/Jobs(viagetAllwith$filter=key in (...))OR.Jobsstop()(stop jobs)/odata/Jobs/UiPath.Server.Configuration.OData.StopJobsOR.JobsFolderScopedService— setsX-UIPATH-OrganizationUnitIdheadergetAll(), then calls the StopJobs OData actionPromise.allPromise<void>— succeeds silently or throws typed errors on failureExample Usage
API Response vs SDK Response
Composition flow
Types
JobStopOptionsSoftStoporKill)StopStrategyjobs.types.tsfor subpath importAdditional Changes
api-client.ts: Replacedcontent-length: 0header check with body-based empty response detection (response.text()→ check empty →JSON.parse)StopStrategyre-export: Re-exported fromjobs.types.tsso the barrelexport *picks it up — removed direct export fromjobs/index.tsFiles
src/utils/constants/endpoints/orchestrator.tssrc/models/orchestrator/jobs.types.tssrc/models/orchestrator/jobs.constants.tssrc/models/orchestrator/jobs.models.tssrc/services/orchestrator/jobs/jobs.tssrc/core/http/api-client.tstests/unit/services/orchestrator/jobs.test.ts(33 tests),tests/unit/models/orchestrator/jobs.test.ts(8 tests)tests/integration/shared/orchestrator/jobs.integration.test.ts(10 tests)tests/utils/constants/jobs.tsdocs/oauth-scopes.md,agent_docs/rules.mdRefs PLT-100574